package com.itheima.tlias.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.tlias.mapper.LogMapper;
import com.itheima.tlias.pojo.OperateLog;
import com.itheima.tlias.pojo.PageResult;
import com.itheima.tlias.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {

	@Autowired
	private LogMapper logMapper;

	@Override
	public PageResult<OperateLog> page(Integer page, Integer pageSize) {
		PageHelper.startPage(page, pageSize);
		Page<OperateLog> logPage = logMapper.page();
		return new PageResult<>(logPage.getTotal(), logPage.getResult());
	}
}
